package com.activity.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.activity.bean.EmployerBean;
import com.donkingliang.groupedadapter.holder.BaseViewHolder;
import com.example.apple.ddhr_new.R;
import com.example.apple.ddhr_new.adapter.BaseAdapter;

import androidx.annotation.NonNull;
import butterknife.BindView;

public class AttanceMemberAdapter extends BaseAdapter<EmployerBean> {



    public AttanceMemberAdapter(Context context) {
        super(context);
    }




    @Override
    public boolean hasHeader(int groupPosition) {
        return true;
    }

    @Override
    public int getHeaderLayout(int viewType) {
        return R.layout.header_empty;
    }

    @Override
    public BaseViewHolder<EmployerBean> getViewHolder(int viewType, View view) {

        if(viewType==TYPE_CHILD)
        return new MemberHolder(view);

        return null;
    }

    @Override
    public int getChildLayout(int viewType) {
        return R.layout.item_attance_member_cell;
    }



    @Override
    public void onBindHeaderViewHolder(com.donkingliang.groupedadapter.holder.BaseViewHolder holder, int groupPosition) {

    }

    public class MemberHolder extends BaseViewHolder<EmployerBean> {
        @BindView(R.id.iv_icon)
        ImageView ivIcon;
        @BindView(R.id.tv_name)
        TextView tvName;

        public MemberHolder(@NonNull View itemView) {
            super(itemView);

        }

        public void setData(EmployerBean data) {

            ivIcon.setSelected(data.selected);
            tvName.setText(data.getUsernickname());

        }


    }


}
